﻿//
// Created by Administrator on 2020/9/8.
//

#include "Person2.h"


Person2::Person2(const char *name, const int age) : name(name), age(age) {

}

Person2::~Person2() {
    std::cout << "free Person2" << std::endl;
}

void Person2::toString() {
    using std::cout;
    using std::endl;

    cout << "Person2 [name:" << this->name << ", age:" << this->age << "]" << endl;
}

std::ostream &operator<<(std::ostream &os, const Person2 &Person2) {
    os << "Person2 << [name:" << Person2.name << ", age:" << Person2.age << "]\n";
    return os;
}